//
//  DnPhotoGallery.h
//  DnPhotoGallery	
//
//  Created by Ngoc on 12/12/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "DnPhotoGridView.h"
#import "DnPhotoGalleryStaticVariables.h"
#import "DnPhotoGalleryServices.h"
#import "FGalleryViewController.h"
#import "SwitchViewController.h"
#include  "EditImage/EditImageViewController.h"
#import "MBProgressHUD.h"
#import "CanvasViewController.h"

typedef enum
{
    DnPhotoNormalMode,
    DnPhotoSelectMode
    
}DnPhotoMode;
typedef enum 
{
    DnPhotoGalleryActionNone,
    DnPhotoGalleryActionDelete,
    DnPhotoGalleryActionDeleteItems
    
}DnPhotoGalleryAction;

@protocol DnPhotoGalleryDelegate;

@interface DnPhotoGallery : UIViewController<DnPhotoGridViewDatasource, DnPhotoViewPageDatasource,ATPagingViewDelegate, FGalleryViewControllerDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, EditImageViewControlerDelegate, UIAlertViewDelegate,DnPhotoGalleryServicesDelegate, MBProgressHUDDelegate, CanvasViewControllerDeleate> {
    DnPhotoGridView *_photoGridView;
    UIButton *_btnDelete;
    UIButton *_btnViewInGallery;
    NSMutableArray *_galleryPages;
    NSMutableArray *_galleryItems;
    
    NSInteger _currentPageIndex;
    NSInteger _currentItemIndex;
    FGalleryViewController *_localGallery;
    IBOutlet UINavigationBar *_navigationBar;
    UINavigationController *_navigationController;
    
    IBOutlet UIToolbar *_topToolbar, *_bottomToolbar;
    id<DnPhotoGalleryDelegate> _delegate;
    BOOL _isInViewGalleryMode;
    DnPhotoGalleryServices *_imageServices;
    BOOL _isCameraOn;
    
    DnPhotoMode _currentMode;
    NSMutableArray *_selectedItems;
    NSInteger _selectedPageIndex;
    BOOL _isCutAction, _isCopyAction;
    //UILabel *_lblCurrentFolderName;
    DnPhotoGalleryAction _photoGalleryAction;
    MBProgressHUD *HUD;
    NSString *_imageInFGalleryPath;
}
@property (nonatomic, retain) id<DnPhotoGalleryDelegate> galleryDelegate;
@property(nonatomic, readonly, getter = getCurrentItem, retain) DnPhotoViewCell* currentItem;
@property(nonatomic, readonly, getter = getCurrentPage, retain) DnPhotoViewPage *  currentPage;
-(IBAction) addImageFromLibrary:(id) sender;
-(IBAction) saveAllImageToLibrary:(id) sender;
-(void) reloadData;
-(id) initWithDelegate:(id<DnPhotoGalleryDelegate>) delegate;
@end

@protocol DnPhotoGalleryDelegate <NSObject>

-(void) galleryInitCompleted:(DnPhotoGallery*) gallery;
@end